package com.tanhua.server.service;

import com.tanhua.autoconfig.template.HuanXinTemplate;
import com.tanhua.autoconfig.vo.HuanXinUserVo;
import com.tanhua.commons.utils.Constants;
import com.tanhua.dubbo.api.UserApi;
import com.tanhua.model.domain.User;
import com.tanhua.server.interceptor.UserHolder;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class HuanxinService {

    @DubboReference
    private UserApi userApi;

    public HuanXinUserVo user() {
        Long userId = UserHolder.getId();
       User user = userApi.findById(userId);
       HuanXinUserVo hxVo = new HuanXinUserVo();
       hxVo.setUsername(user.getHxUser());
       hxVo.setPassword(user.getHxPassword());
       return hxVo;
    }
}
